package user;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Locale;

@SuppressWarnings("deprecation")
public class User {

	private String UName;
	private String USurname;
	private String UMiddlename;
	private Date birth;

	public Date getBirth() {
		return birth;
	}

	public int getBirthDay() {
		return birth.getDate();
	}

	public int getBirthMonth() {
		return birth.getMonth();
	}

	public int getBirthYear() {
		return birth.getYear();
	}

	public void setBirth(Date birth) {
		this.birth = birth;
	}

	public void setBirthDay(int birth) {
		this.birth.setDate(birth);
	}

	public void setBirthMonth(int birth) {
		this.birth.setMonth(birth);
	}

	public void setBirthYear(int birth) {
		this.birth.setYear(birth);
	}

	public String getUName() {
		return UName;
	}

	public void setUName(String uName) {
		UName = uName;
	}

	public String getUSurname() {
		return USurname;
	}

	public void setUSurname(String uSurname) {
		USurname = uSurname;
	}

	public String getUMiddlename() {
		return UMiddlename;
	}

	public void setUMiddlename(String uMiddlename) {
		UMiddlename = uMiddlename;
	}

	public boolean UCompare(User u) {
		return this.getBirthDay() == u.getBirthDay()
				&& this.getBirthMonth() == u.getBirthMonth();
	}

	public String printBirth() {
		return new SimpleDateFormat("dd MMMM yyyy", new Locale("RU"))
				.format(birth);
	}

	public boolean UThisIsOlder(User u){
		return this.birth.before(u.getBirth());
	}
	
	public Date getTotalDays(){
		Date aDate = new Date(System.currentTimeMillis());
		Calendar calendar = GregorianCalendar.getInstance();
		calendar.setTime(aDate);
		return aDate;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}
}
